/**
 * 
 */
package org.gigi.security.spring;

import org.gigi.security.domain.Authority;
import org.springframework.security.core.GrantedAuthority;

/**
 * 用于spring security的Authority扩展。
 *
 * @author Eugene Wang 2011-11-11
 * @see
 */
public class GigiGrantedAuthority extends Authority implements GrantedAuthority {
	private static final long serialVersionUID = 2877048269462005528L;

	/**
	 * 默认构造函数
	 */
	public GigiGrantedAuthority() {
	}

	/**
	 * 构造函数
	 * @param authority
	 */
	public GigiGrantedAuthority(Authority authority) {
		this.setCode(authority.getCode());
		this.setDescription(authority.getDescription());
	}
	/* (non-Javadoc)
	 * @see org.springframework.security.core.GrantedAuthority#getAuthority()
	 */
	@Override
	public String getAuthority() {
		return getCode();
	}

}
